//
//  Rate.swift
//  Wallet
//
//  Created by Julian on 2022/5/7.
//

import Foundation

/// 实时币汇率
struct TierInfo: Codable {
    let tiers: [Tiers]
    
    // 空情况
    static let empty = TierInfo(tiers: [])
}

struct Tiers: Codable {
    let cryptoCurrency: String
    let rates: [Rate]
    
    // key 映射
    enum CodingKeys: String, CodingKey {
        case cryptoCurrency = "crypto_currency"
        case rates
    }
}

// 汇率信息
struct Rate: Codable {
    let fiatCurrency: String
    let rate: String
    
    // key 映射
    enum CodingKeys: String, CodingKey {
        case fiatCurrency = "fiat_currency"
        case rate
    }
}

